/*************************************** Copyright ******************************   
  * FileName   : Encoder_Func.h   
  * Version    : v1.0		
  * Author     : --		
  * Date       : 2022-11-14         
  * Description:    
  * Function List:  
  	1. ....
  	   <version>: 		
  <modify staff>:
  		  <data>:
   <description>:  
  	2. ...
  ******************************************************************************/

#ifndef __ENCODER__FUNC_H_
#define __ENCODER__FUNC_H_

/*include----------------------------------------------------------------------*/
#include "main.h"
#include "tim.h"

/*define-----------------------------------------------------------------------*/


/*variate statement------------------------------------------------------------*/

typedef struct {
    TIM_HandleTypeDef *Tim_HandleTypeDef;
    uint8_t direction;
    uint16_t Long_press_time;
		uint32_t count_32;
		int16_t update_value;
		uint8_t key_short;
		uint8_t key_long;
} Encoder_TypeDef;

extern Encoder_TypeDef Enc_1;


/*function statement-----------------------------------------------------------*/

HAL_StatusTypeDef Encoder_Init(Encoder_TypeDef *Enc,TIM_HandleTypeDef *htim);
void Encoder_count(Encoder_TypeDef *Enc,uint32_t count,uint32_t DT_ms);
void Encoder_Key_scan(Encoder_TypeDef *Enc,uint32_t Key_state);


#endif



















 

